package com.cloudschool.orders.service;

import com.cloudschool.messagesdk.model.po.MqMessage;
import com.cloudschool.orders.model.dto.AddOrderDto;
import com.cloudschool.orders.model.dto.PayRecordDto;
import com.cloudschool.orders.model.dto.PayStatusDto;
import com.cloudschool.orders.model.po.XcPayRecord;

/**
 * @author chenhong
 * @version 1.0
 * @description TODO
 * @date 2023/3/23 19:12
 */
public interface OrderService {
    /**
    * @description 创建商品订单
    * @param userId 
     * @param addOrderDto 
    * @return com.cloudschool.orders.model.dto.PayRecordDto
    * @author chenhong
    * @date 2023/3/23 19:13
    */
    public PayRecordDto createOrder(String userId, AddOrderDto addOrderDto);

    /**
    * @description 查询支付记录
    * @param payNo 
    * @return com.cloudschool.orders.model.po.XcPayRecord
    * @author chenhong
    * @date 2023/3/23 19:37
    */
    XcPayRecord getPayRecordByPayno(String payNo);


    /**
    * @description 请求支付宝查询支付结果
    * @param payNo 
    * @return com.cloudschool.orders.model.dto.PayRecordDto
    * @author chenhong
    * @date 2023/3/24 12:31
    */
    PayRecordDto queryPayResult(String payNo);

    void saveAliPayStatus(PayStatusDto payStatusDto) ;


    /**
    * @description 发送通知结果
    * @param message 
    * @return void
    * @author chenhong
    * @date 2023/3/25 16:44
    */
    public void notifyPayResult(MqMessage message);
}
